package independentes;

public class Fibonacci implements Runnable {
	
	private int num, result;
	
	public Fibonacci(int num) {
		this.num = num;
	}
	
	public int getResult() {
		return result;
	}

	public int fibonacci(int num) {
		if (num < 2)
			return num;
		
		int result = fibonacci(num - 1) + fibonacci(num - 2);
		
		return result;
	}

	@Override
	public void run() {
		result = fibonacci(num);
	}
}